#!/usr/bin/python
# vim:fileencoding=utf8
"""
Тестирующий модуль.
"""



import unittest
import object
import action

from gnTai.words.noun import Noun
from gnTai.words.verb import Verb

class TestObject(unittest.TestCase):
    
    def setUp(self):
        self.a_love = object.Object(Noun('love'), definite=False)
        self.the_loves = object.Object(Noun('love'), definite=True, plurum=True)

    
    def teststr(self):
        self.assertEqual(self.a_love.to_string(), "a love")
        self.assertEqual(self.the_loves.to_string(), "the loves")
        
class TestAction(unittest.TestCase):
    
    def setUp(self):
        self.exist1s = action.Action(Verb('exist') )
        self.exist3s = action.Action(Verb('exist') )
           
    def teststr(self):
        self.assertEqual(self.exist1s.to_string(person=1, plurum=False), "exist")
        self.assertEqual(self.exist3s.to_string(person=3, plurum=False), "exists")
    
        
def suite():
    tests = ['teststr']
    res = unittest.TestSuite()
    res.addTests([TestAction(tc) for tc in tests])
    res.addTests([TestObject(tc) for tc in tests])
    return res
        
if __name__ == '__main__':
    unittest.main()

    